package com.adcc.loadsheet.monitor.vo;

import com.adcc.loadsheet.monitor.entity.AirInfoMonitor;
import com.adcc.loadsheet.monitor.entity.MonitorStatus;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.base.Strings;

public class AirInfoMonitorVO extends BaseVO<AirInfoMonitor> {

    // 入TOPIC消息数
    private long enqueued;

    // 最新报文更新时间
    private String updateTime;

    // 无报文接收时间
    private long noReceiveTime;

    // MQ状态
    private boolean mqStatus;

    // TOPIC状态
    private boolean topicStatus;

    // 航信状态
    private MonitorStatus status;

    public AirInfoMonitorVO() {

    }

    public AirInfoMonitorVO(AirInfoMonitor airInfoMonitor) {
        enqueued = airInfoMonitor.getEnqueued();
        updateTime = Strings.nullToEmpty(airInfoMonitor.getUpdateTime() != null ? airInfoMonitor.getUpdateTime().toString("yyyy-MM-dd HH:mm:ss") : "");
        noReceiveTime = airInfoMonitor.getNoReceiveTime();
        mqStatus = airInfoMonitor.isMqStatus();
        topicStatus = airInfoMonitor.isTopicStatus();
        status = airInfoMonitor.getStatus();
    }

    public long getEnqueued() {
        return enqueued;
    }

    public void setEnqueued(long enqueued) {
        this.enqueued = enqueued;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public long getNoReceiveTime() {
        return noReceiveTime;
    }

    public void setNoReceiveTime(long noReceiveTime) {
        this.noReceiveTime = noReceiveTime;
    }

    public boolean isMqStatus() {
        return mqStatus;
    }

    public void setMqStatus(boolean mqStatus) {
        this.mqStatus = mqStatus;
    }

    public boolean isTopicStatus() {
        return topicStatus;
    }

    public void setTopicStatus(boolean topicStatus) {
        this.topicStatus = topicStatus;
    }

    public MonitorStatus getStatus() {
        return status;
    }

    public void setStatus(MonitorStatus status) {
        this.status = status;
    }

    @Override
    public AirInfoMonitor toEntity() {
        return null;
    }

    @Override
    public String toJSON() throws JsonProcessingException {
        return null;
    }
}
